<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::Plugin::Rack</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (R)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Plugin.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin.html" title="Sass::Plugin (module)">Plugin</a></span>
     &raquo; 
    <span class="title">Rack</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Plugin/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Plugin/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::Plugin::Rack 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">Sass::Plugin::Rack</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/plugin/rack.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>Rack middleware for compiling Sass code.</p>

<h2 id='activate'>Activate</h2>

<pre class="code">require &#39;sass/plugin/rack&#39;
use Sass::Plugin::Rack</pre>

<h2 id='customize'>Customize</h2>

<pre class="code">Sass::Plugin.options.merge(
  :cache_location =&gt; &#39;./tmp/sass-cache&#39;,
  :never_update =&gt; environment != :production,
  :full_exception =&gt; environment != :production)</pre>

<p><a href="file.SASS_REFERENCE.html#options" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#options" title="See the Reference for more options">See the Reference for more options</a>.</p>

<h2 id='use'>Use</h2>

<p>Put your Sass files in <code>public/stylesheets/sass</code>. Your CSS will be generated in <code>public/stylesheets</code>, and regenerated every request if necessary. The locations and frequency <a href="file.SASS_REFERENCE.html#options" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#options" title="can be customized">can be customized</a>. That&#8217;s all there is to it!</p>

  </div>
</div>
<div class="tags">
  
</div>

  <h2>Instance Attribute Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#dwell-instance_method" title="#dwell (instance method)">- (Float) <strong>dwell</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  

  
    <span class="summary_desc">The delay, in seconds, between update checks.</span>
  
</li>

    
  </ul>


  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#call-instance_method" title="#call (instance method)">- ((#to_i, {String =&gt; String}, Object)) <strong>call</strong>(env) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Process a request, checking the Sass stylesheets for changes and updating them if necessary.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Rack) <strong>initialize</strong>(app, dwell = 1.0) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  

  
    <span class="summary_desc">Initialize the middleware.</span>
  
</li>

    
  </ul>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::Plugin::Rack (class)">Rack</a></tt>) <strong>initialize</strong>(app, dwell = 1.0) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Initialize the middleware.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>#call</tt>)</span>
      
      
        <span class='name'>app</span>
      
      
      
        &mdash;
        The Rack application
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>Float</tt>)</span>
      
      
        <span class='name'>dwell</span>
      
      
        <em class="default">(defaults to: <tt>1.0</tt>)</em>
      
      
        &mdash;
        See <tt><a href="#dwell-instance_method" title="Sass::Plugin::Rack#dwell (method)">#dwell</a></tt>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


38
39
40
41
42</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/rack.rb', line 38</span>

def initialize(app, dwell = 1.0)
  @app = app
  @dwell = dwell
  @check_after = Time.now.to_f
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id="dwell=-instance_method"></span>
      <span id="dwell-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="dwell-instance_method">
  
    - (<tt>Float</tt>) <strong>dwell</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The delay, in seconds, between update checks. Useful when many resources are requested for a single page. <code>nil</code> means no delay at all.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Float</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


32
33
34</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/rack.rb', line 32</span>

def dwell
  @dwell
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="call-instance_method">
  
    - (<tt>(#to_i, {String =&gt; String}, Object)</tt>) <strong>call</strong>(env) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Process a request, checking the Sass stylesheets for changes and updating them if necessary.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'></span>
      
      
        <span class='name'>env</span>
      
      
      
        &mdash;
        The Rack request environment
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>(#to_i, {String =&gt; String}, Object)</tt>)</span>
      
      
      
      
        &mdash;
        The Rack response
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


49
50
51
52
53
54
55</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/rack.rb', line 49</span>

def call(env)
  if @dwell.nil? || Time.now.to_f > @check_after
    Sass::Plugin.check_for_updates
    @check_after = Time.now.to_f + @dwell if @dwell
  end
  @app.call(env)
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:45 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>